<script>
    var array=["aa","bb","cc","dd","ee"];
    var str=array[0];
    var seperator="|";
    for (let i = 0; i < array.length; i++) {
        str+=seperator+array[i];
    }
    console.log(str);
</script>